// 字符串中   最长 数字 字串
const pattern = /\d+/g

while ((line = readline())) {
  let res = line.match(pattern)
  let max = 0
  for (let v of res) {
    if (v.length > max) max = v.length
  }
  let resStr = ''

  for (let v of res) {
    if (v.length === max) resStr += v
  }
  console.log(resStr + ',' + max)
}
